/**
*		@file BlkTable.h
*		@brief BlkTable class
*
*		@author Kong Ling Ming
*
*		@date 3/17/2012
*/
#ifndef BLKTABLE_H
#define BLKTABLE_H

#include "BlkNode.h"
#include "Modifies.h"
#include "StmtTable.h"
#include "Calls.h"
#include "Uses.h"
#include "Next.h"
#include <string>

using namespace std;

class BlkTable{
public:
	
	static void		RebuildBlkTable();

	/**
	*		@brief This method will return the number of BlkNodes in BlkTable
	*/
	static int		GetSize(){ return vp_blknode_.size(); };

	/**
	*		@brief This method will return the reference to BlkNode with blk_idx
	*/
	static BlkNode*	GetBlkNode(BlkIdx blk_idx);

	static BlkSet&	GetNextBlkRight(BlkIdx blk_idx);
	static BlkSet&	GetNextBlkLeft(BlkIdx blk_idx);

	static string	ToString();
private:
	static TNode*	BuildBlkNode(TNode* current_tnode);
	static void		BuildBlkNextTable();
	static void		BuildBlkNextTableT();
	static void		BuildProcPathTable();

	static vector<BlkNode*>	vp_blknode_;
	static vector<BlkSet>	blk_next_table_;
	static vector<BlkSet>	blk_next_table_t_;
};

#endif